package com.matt.repository.impl;

import com.matt.foundation.DO.StaffAreaDO;
import com.matt.repository.base.BaseNativeSqlRepository;
import com.matt.repository.base.TeacherCoursePlanNurseryRepository;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2018/3/13
 * *******************************
 */
@Component
public class TeacherCoursePlanNurseryRepositoryImpl extends BaseNativeSqlRepository implements TeacherCoursePlanNurseryRepository{

    @Override
    public List<StaffAreaDO> findByCoursePlanNursery(String nurseryId) {
        String findTeacherSql=String.format("SELECT rel.teacherName as realName, rel.teacherId  as staffId" +
                " from rel_teacher_course_plan_nursery rel  " +
                " where rel.classesPlanId = '%s' ", nurseryId);
        List<StaffAreaDO> objectArrayList = sqlObjectList(findTeacherSql, StaffAreaDO.class);
        return objectArrayList;
    }
}
